import React from "react";
import News from "@/pages/News.jsx"
import Message from "@/pages/Message.jsx"
import {NavLink, Route, Redirect, Switch} from "react-router-dom"

export default class Home extends React.Component {
  constructor(props) {
    super(props);
  }

  render() {
    return (
        <div>
          <h4>我是Home</h4>
          <ul>
            <NavLink activeClassName="active" to="/home/news">news</NavLink>
            &nbsp;
            <NavLink activeClassName="active" to="/home/message">message</NavLink>
          </ul>
          <div className="content">
            <Switch>
              <Route path="/home/news" component={News}></Route>
              <Route path="/home/message" component={Message}></Route>
              <Redirect to="/home/news"></Redirect>
            </Switch>
          </div>
        </div>
    )
  }
}